package idiet.bean;

import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the unit database table.
 * 
 */
@Entity
public class Unit implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int id;

	private String comment;

	@Column(name="en_name")
	private String enName;

	@Column(name="lm_timestamp")
	private Timestamp lmTimestamp;

	private String name;

	//bi-directional many-to-one association to CustomerNurseMealRecipe
	@OneToMany(mappedBy="unit")
	private List<CustomerNurseMealRecipe> customerNurseMealRecipes;

	//bi-directional many-to-one association to FoodIngredientElementUnit
	@OneToMany(mappedBy="unit")
	private List<FoodIngredientElement> foodIngredientElements;

	//bi-directional many-to-one association to MealRecipe
	@OneToMany(mappedBy="unit")
	private List<MealRecipe> mealRecipes;

	public Unit() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getEnName() {
		return this.enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	public Timestamp getLmTimestamp() {
		return lmTimestamp;
	}

	public void setLmTimestamp(Timestamp lmTimestamp) {
		this.lmTimestamp = lmTimestamp;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<CustomerNurseMealRecipe> getCustomerNurseMealRecipes() {
		return this.customerNurseMealRecipes;
	}

	public void setCustomerNurseMealRecipes(List<CustomerNurseMealRecipe> customerNurseMealRecipes) {
		this.customerNurseMealRecipes = customerNurseMealRecipes;
	}

	public List<FoodIngredientElement> getFoodIngredientElements() {
		return foodIngredientElements;
	}

	public void setFoodIngredientElements(
			List<FoodIngredientElement> foodIngredientElements) {
		this.foodIngredientElements = foodIngredientElements;
	}

	public List<MealRecipe> getMealRecipes() {
		return this.mealRecipes;
	}

	public void setMealRecipes(List<MealRecipe> mealRecipes) {
		this.mealRecipes = mealRecipes;
	}

	@Override
	public String toString() {
		return "Unit [id=" + id + ", name=" + name + ", enName=" + enName
				+ ", comment=" + comment + ", lmTimestamp=" + lmTimestamp + "]";
	}
	
}